import { request } from './request'
import type { Result } from '@/types/api'
import GatewayType from '@/api/gateway'
import type { RegisterUserDto, LoginResult, LoginDto } from '@/types'

export const loginApi = (data: LoginDto) => request<Result<LoginResult>>({
    url: `${GatewayType.user}/login`,
    method: 'post',
    data
})
export const registerCaptchaApi = (address: string) => request<Result>({
    url: `${GatewayType.user}/register-captcha`,
    params: {
        address
    }
})
export const registerApi = (data: RegisterUserDto) => request<Result>({
    url: `${GatewayType.user}/register`,
    method: 'post',
    data
})
